import {
    Loading
} from "element-ui";

let loadingInstance = null;

export const openLoading = (text = "加载中...") => {
    loadingInstance = Loading.service({
        target: 'app',
        text,
        background: "rgba(0, 0, 0, 0.8)"
    });
};

export const closeLoading = () => {
    if (loadingInstance) {
        loadingInstance.close();
    }
};